<html>
    <meta charset='utf8'>
    <body>
        <form action="">
            <p>姓名：<input type="text" name='username'></p>
            <p>电话：<input type="text" name='phone'></p>
            <button>提交</button>
        </form>
    </body> 
</html>

<?php
    $username = $_REQUEST["username"];
    $phone = $_REQUEST["phone"];
    
    if(!$username || !$phone){
        die();
    }

    $link = mysql_connect("localhost","root","root");
    mysql_select_db(test);
    mysql_query("set names utf8");    

    // 增加
    $addsql = "INSERT INTO `userlist` (`username`,`phone`) VALUES ('$username','$phone')";
    mysql_query($addsql);


    mysql_close($link);
?>